<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Namespace: hmac</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Namespace: hmac</h1>

    




<section>

<header>
    
        <h2>
            <span class="ancestors"><a href="md5_.html">md5</a>.</span>hmac</h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

        


<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line207">line 207</a>
    </li></ul></dd>
    

    

    

    
</dl>


        
    
    </div>

    

    

    

    

    

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id=".array"><span class="type-signature">(static) </span>array<span class="signature">(key, message)</span><span class="type-signature"> &rarr; {Array}</span></h4>
    

    



<div class="description">
    Output hash as bytes array
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">key</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">message to hash</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line233">line 233</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    Bytes array
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>md5.hmac.array('key', 'The quick brown fox jumps over the lazy dog');</code></pre>



        
            

    

    
    <h4 class="name" id=".arrayBuffer"><span class="type-signature">(static) </span>arrayBuffer<span class="signature">(key, message)</span><span class="type-signature"> &rarr; {ArrayBuffer}</span></h4>
    

    



<div class="description">
    Output hash as ArrayBuffer
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">key</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">message to hash</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line243">line 243</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ArrayBuffer
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">ArrayBuffer</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>md5.hmac.arrayBuffer('key', 'The quick brown fox jumps over the lazy dog');</code></pre>



        
            

    

    
    <h4 class="name" id=".base64"><span class="type-signature">(static) </span>base64<span class="signature">(key, message)</span><span class="type-signature"> &rarr; {String}</span></h4>
    

    



<div class="description">
    Output hash as base64 string
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">key</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">message to hash</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line264">line 264</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    base64 string
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>md5.hmac.base64('key', 'The quick brown fox jumps over the lazy dog');</code></pre>



        
            

    

    
    <h4 class="name" id=".buffer"><span class="type-signature">(static) </span>buffer<span class="signature">(key, message)</span><span class="type-signature"> &rarr; {ArrayBuffer}</span></h4>
    

    



<div class="description">
    Output hash as ArrayBuffer
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">key</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">message to hash</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    
        <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.</li></ul></dd>
    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line253">line 253</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ArrayBuffer
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">ArrayBuffer</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>md5.hmac.buffer('key', 'The quick brown fox jumps over the lazy dog');</code></pre>



        
            

    

    
    <h4 class="name" id=".create"><span class="type-signature">(static) </span>create<span class="signature">(key)</span><span class="type-signature"> &rarr; {<a href="HmacMd5.html">HmacMd5</a>}</span></h4>
    

    



<div class="description">
    Create HmacMd5 object
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">key</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line280">line 280</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    HmacMd5 object.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="HmacMd5.html">HmacMd5</a></span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>var hash = md5.hmac.create('key');</code></pre>



        
            

    

    
    <h4 class="name" id=".digest"><span class="type-signature">(static) </span>digest<span class="signature">(key, message)</span><span class="type-signature"> &rarr; {Array}</span></h4>
    

    



<div class="description">
    Output hash as bytes array
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">key</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">message to hash</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line223">line 223</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    Bytes array
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>md5.hmac.digest('key', 'The quick brown fox jumps over the lazy dog');</code></pre>



        
            

    

    
    <h4 class="name" id=".hex"><span class="type-signature">(static) </span>hex<span class="signature">(key, message)</span><span class="type-signature"> &rarr; {String}</span></h4>
    

    



<div class="description">
    Output hash as hex string
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">key</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">message to hash</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line210">line 210</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    Hex string
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>md5.hmac.hex('key', 'The quick brown fox jumps over the lazy dog');
// equal to
md5.hmac('key', 'The quick brown fox jumps over the lazy dog');</code></pre>



        
            

    

    
    <h4 class="name" id=".update"><span class="type-signature">(static) </span>update<span class="signature">(key, message)</span><span class="type-signature"> &rarr; {<a href="HmacMd5.html">HmacMd5</a>}</span></h4>
    

    



<div class="description">
    Create and update HmacMd5 object
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">key</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>message</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">Uint8Array</span>
|

<span class="param-type">ArrayBuffer</span>


            
            </td>

            

            

            <td class="description last">message to hash</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line289">line 289</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    HmacMd5 object.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="HmacMd5.html">HmacMd5</a></span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>var hash = md5.hmac.update('key', 'The quick brown fox jumps over the lazy dog');
// equal to
var hash = md5.hmac.create('key');
hash.update('The quick brown fox jumps over the lazy dog');</code></pre>



        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="md5_.html">md5</a></li><li><a href="md5.hmac.html">hmac</a></li></ul><h3>Classes</h3><ul><li><a href="HmacMd5.html">HmacMd5</a></li><li><a href="Md5.html">Md5</a></li></ul><h3>Global</h3><ul><li><a href="global.html#md5%2508">md5</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Wed Sep 27 2023 21:32:04 GMT+0800 (台北標準時間)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>